package cn.wei.youvie.service;

import cn.wei.youvie.common.servlet.DeleteRequest;
import cn.wei.youvie.domain.dto.book.BookAddRequest;
import cn.wei.youvie.domain.dto.book.BookQueryRequest;
import cn.wei.youvie.domain.dto.book.BookUpdateRequest;
import cn.wei.youvie.domain.entity.Book;
import cn.wei.youvie.domain.vo.BookVO;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;

/**
* @author Youvie
* @description 针对表【books(存储书籍的基本信息)】的数据库操作Service
* @createDate 2024-08-27 21:02:05
*/
public interface BookService extends IService<Book> {


    Integer add(BookAddRequest booksAddRequest, HttpServletRequest request);

    boolean deleteBook(DeleteRequest deleteRequest, HttpServletRequest request);

    boolean updateBook(BookUpdateRequest booksUpdateRequest);

    BookVO getBookVO(Book book, HttpServletRequest request);

    Wrapper<Book> getQueryWrapper(BookQueryRequest booksQueryRequest);

    Page<BookVO> getBookVOPage(Page<Book> booksPage, HttpServletRequest request);

    Book getBookBySectionId(Integer sectionId);

    boolean insertContentOfFile(MultipartFile file, HttpServletRequest request, int bookId);
}
